package com.iotechn.unimall.admin.myapi.record;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.annotation.param.Range;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.mydata.domain.CourseBean;
import com.iotechn.unimall.mydata.domain.RecordsBean;
import com.iotechn.unimall.mydata.domain.ScoreRecordBean;
import org.springframework.stereotype.Service;

import java.util.List;

@HttpOpenApi(group = "course.record",description = "学习进度和积分")
public interface IRecordService {

    @HttpMethod(description = "创建记录并加5积分")
    String create(
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid,
            @NotNull @HttpParam(name="parentId",type = HttpParamType.COMMON, description = "父课程id") Long parentId,
            @NotNull @HttpParam(name="sonId",type = HttpParamType.COMMON, description = "子课程id") Long sonId
            ) throws ServiceException;

    @HttpMethod(description = "总记录")
    Integer recordNum() throws ServiceException;

    @HttpMethod(description = "学生总进度")
    Integer studentRecordNum(
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid
    ) throws ServiceException;

    @HttpMethod(description = "课程总记录")
    Integer courseRecordNum(
            @NotNull @HttpParam(name="parentId",type = HttpParamType.COMMON, description = "父课程id") Long parentId
    ) throws ServiceException;

    @HttpMethod(description = "课程学生进度")
    Integer courseStudentRecordNum(
            @NotNull @HttpParam(name="parentId",type = HttpParamType.COMMON, description = "父课程id") Long parentId,
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid
    ) throws ServiceException;

    @HttpMethod(description = "学生所有记录进度")
    List<RecordsBean> studentRecords(
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid,
            @Range(min = 1) @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "当前页码") Integer pageNo,
            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度") Integer limit
    ) throws ServiceException;

    @HttpMethod(description = "我的积分")
    Integer score(
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid
    ) throws ServiceException;

    @HttpMethod(description = "积分来源列表")
    List<ScoreRecordBean> scoreList(
            @NotNull @HttpParam(name="sid",type = HttpParamType.COMMON, description = "学生用户id") Long sid
    ) throws ServiceException;





}
